CFLAGS = -Wall -fpic -coverage -lm -std=c99

default: unittestresults.out

unittestresults.out: unittest1.c unittest2.c unittest3.c unittest4.c dominion.c rngs.c

	echo "Result for running updateCoins tests:" > unittestresults.out
	echo "unittest1.c:" >> unittestresults.out
	gcc -o unittest1 dominion.c unittest1.c rngs.c $(CFLAGS)
	unittest1 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	
	echo " " >>unittestresults.out
	echo "Result for running isGameOver tests:" >> unittestresults.out
	echo "unittest2.c:" >> unittestresults.out
	gcc -o unittest2 dominion.c unittest2.c rngs.c $(CFLAGS)
	unittest2 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	
	echo " " >> unittestresults.out
	echo "Result for running scoreFor tests:" >> unittestresults.out
	echo "unittest3.c:" >> unittestresults.out
	gcc -o unittest3 dominion.c unittest3.c rngs.c $(CFLAGS)
	unittest3 >> unittestresults.out
	gcov dominion.c >> unittestresults.out
	
	echo " " >> unittestresults.out
	echo "Result for running getWinners tests:" >> unittestresults.out
	echo "unittest4.c:" >> unittestresults.out
	gcc -o unittest4 dominion.c unittest4.c rngs.c $(CFLAGS)
	unittest4 >> unittestresults.out	
	gcov dominion.c >> unittestresults.out
	
	
	echo " " >> unittestresults.out
	echo "Result for running cardIsSmithy tests:" >> unittestresults.out
	echo "cardtest1.c:" >> unittestresults.out
	gcc -o cardtest1 dominion.c cardtest1.c rngs.c $(CFLAGS)
	cardtest1 >> unittestresults.out	
	gcov dominion.c >> unittestresults.out
	
	
	echo " " >> unittestresults.out
	echo "Result for running cardIsGardens tests:" >> unittestresults.out
	echo "cardtest2.c:" >> unittestresults.out
	gcc -o cardtest2 dominion.c cardtest2.c rngs.c $(CFLAGS)
	cardtest2 >> unittestresults.out	
	gcov dominion.c >> unittestresults.out
	
	echo " " >> unittestresults.out
	echo "Result for running cardIsCouncilRoom tests:" >> unittestresults.out
	echo "cardtest3.c:" >> unittestresults.out
	gcc -o cardtest3 dominion.c cardtest3.c rngs.c $(CFLAGS)
	cardtest3 >> unittestresults.out	
	gcov dominion.c >> unittestresults.out
	
	echo " " >> unittestresults.out
	echo "Result for running cardIsAdventurer tests:" >> unittestresults.out
	echo "cardtest4.c:" >> unittestresults.out
	gcc -o cardtest4 dominion.c cardtest4.c rngs.c $(CFLAGS)
	cardtest4 >> unittestresults.out	
	gcov dominion.c >> unittestresults.out
	
			
clean:
	rm unittestresults.out

cleanall: 
	rm unittestresults.out unittest1 unittest2 unittest3 unittest4 *.gcda *.gcno *.gcov
